<?php
		require_once(dirname(__FILE__) . '/../../lib/PageLayout.php');
		require_once(dirname(__FILE__) . '/../../lib/MarketDB.php');
		
		$marketDB = new MarketDB();
		$chars = $marketDB->getChars();
		$align = array("center", "right");
		$data = array();
		$sum = 0;
		
		
		for ($i = 0; $i < count($chars); $i++) {
			$data[] = array( utf8_encode($chars[$i]['name']), getGoldOnly($chars[$i]['wealth']) );
			$sum += $chars[$i]['wealth'];
		}
		$data[] = array ( "Total", getGoldOnly($sum));
		$wealth = new Table();
		$wealth->setStyle( array('padding' => 0, 'background-color' => 'green', 'width' => '100%') );
		$wealth->setHorizMargin('auto');
		$wealth->setVertMargin('0px');
		$wealth->addData($data);
		$wealth->setAlign($align);
		$wealth->useSessions();
		$wealth->printTable();
		unset($marketDB);

?>